// timeUtil.js
function getDetailedDateTime() {
  // 获取当前时间
  let currentTime = new Date();
  console.log(currentTime);

  // 获取当前时间的时区偏移量，单位为分钟
  let timezoneOffset = currentTime.getTimezoneOffset();

  // 北京时区偏移量为东八区，即480分钟
  let beijingOffset = 480;

  // 将当前时间的分钟数加上北京时区偏移量
  currentTime.setMinutes(currentTime.getMinutes() + beijingOffset + timezoneOffset);

  // 格式化时间
  let year = currentTime.getFullYear();
  let month = String(currentTime.getMonth() + 1).padStart(2, '0');
  let date = String(currentTime.getDate()).padStart(2, '0');
  let hours = String(currentTime.getHours()).padStart(2, '0');
  let minutes = String(currentTime.getMinutes()).padStart(2, '0');
  let seconds = String(currentTime.getSeconds()).padStart(2, '0');

  // 返回格式化后的时间字符串
  return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`;
}




export default getDetailedDateTime